def factorial(num):
    if num == 1:
        return 1
    else:
        return num*factorial(num - 1)


if __name__ == "__main__":
    ans = 0
    n = int(input(""))
    for i in range(1, n+1):
        ans += factorial(i)
    print(ans)
